#include<head.h>


int Time(void)
{
    time_t t_1;
    FILE * fp = fopen("time.txt" , "a+");
    FOPEN_ERR(fp);  // 判断是否错误
    fseek(  fp , 0 , SEEK_SET );

        t_1 = time(NULL);
        struct tm *l_time = localtime(&t_1);
        fprintf(fp , "%d月%d日%d时%d分%d秒 \n", \
        l_time->tm_mon + 1 , l_time->tm_mday , l_time->tm_hour , \
        l_time->tm_min , l_time->tm_sec);
        
    
    fclose(fp);
    return 0;
}


int main(int argc, char const *argv[])
{
    while (1)
    {
        Time();
        sleep(1);
    }
    
    
    return 0;
}

